#include "config.h"
#include "GPIO_InIt.h"
#include "MyTimer.h"
#include "IR_Exit.h"
u16 Timer;

void UART_config(void)
{
	COMx_InitDefine		COMx_InitStructure;					
	COMx_InitStructure.UART_Mode      = UART_8bit_BRTx;
	COMx_InitStructure.UART_BRT_Use   = BRT_Timer1;
	COMx_InitStructure.UART_BaudRate  = 9600;
	COMx_InitStructure.UART_RxEnable  = ENABLE;
	COMx_InitStructure.BaudRateDouble = DISABLE;
	COMx_InitStructure.UART_Interrupt = ENABLE;
	COMx_InitStructure.UART_Priority  = Priority_0;
	COMx_InitStructure.UART_P_SW      = UART1_SW_P30_P31;
	UART_Configuration(UART1, &COMx_InitStructure);
	EA=1;//中断总开关
}

void main()
{
	GPIO_Init();
	Exti_Init();
	Timer_Init();
	UART_config();
	
	while(1)
	{
		Delay_ms(1000);//官方提供的延时函数，实际大约200ms

		Timer0_SetCounter();//清零
	
		TR0=1;//开启计时
		Delay_ms(1);//延时1ms
		TR0=0;//关闭计时
		
		TX1_write2buff(TH0);//发送数据
		TX1_write2buff(TL0);//发送数据		
		
		Timer0_SetCounter();//清零
	}
}

void Ext_INT1 (void) interrupt INT1_VECTOR		//进中断时已经清除标志
{

}


	
